package cn.zjh.school.service.impl;

import cn.zjh.base.utils.PageList;
import cn.zjh.school.domain.Student;
import cn.zjh.school.mapper.StudentMapper;
import cn.zjh.school.query.StudentQuery;
import cn.zjh.school.service.IStudentService;
import cn.zjh.user.service.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zjh
 * @since 2022-07-03
 */
@Service
public class StudentServiceImpl extends BaseServiceImpl<Student> implements IStudentService {

    @Autowired
    private StudentMapper studentMapper;


    @Override
    public PageList<Student> getData(Long id, StudentQuery studentQuery) {

        List<Student> rows = studentMapper.getData(id,studentQuery);
        System.out.println(rows);

        Integer total = studentMapper.drawerQueryCount(id);

        return new PageList<>(total,rows);
    }
}
